/*
 * @Author: lijilong
 * @Date: 2024-09-09 16:38:50
 * @LastEditors: lijilong lijilong@thwater.com
 * @LastEditTime: 2024-09-11 10:21:05
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import { request } from '@/utils/request';

export function fetchList(query?: Object) {
  return request({
    url: '/pm/rdReply/page',
    method: 'GET',
    query,
  });
}

export function getObj(id?: string) {
  return request({
    url: '/pm/rdReply/' + id,
    method: 'GET',
  });
}

export function addObj(obj?: Object) {
  return request({
    url: '/pm/rdReply',
    method: 'POST',
    data: obj,
  });
}

export function putObj(obj?: Object) {
  return request({
    url: '/pm/rdReply',
    method: 'PUT',
    data: obj,
  });
}

/**
 * 发起审批
 * @param obj
 * @returns
 */
export function submitProcess(obj?: Object) {
  return request({
    url: '/pm/rdReply/submitProcess',
    method: 'POST',
    data: obj,
  });
}

/**
 * 撤回
 * @param obj
 * @returns
 */
export function revokeProcess(obj?: any) {
  return request({
    url: `/pm/rdReply/revoke?comment=${obj.comment}`,
    method: 'POST',
    data: obj,
  });
}
/**
 * 同意
 * @param obj
 * @param id
 * @returns
 */
export function complete(obj?: Object, id?: string) {
  return request({
    url: '/pm/rdReply/complete?id=' + id,
    method: 'POST',
    data: obj,
  });
}

/**
 * 驳回
 * @param obj
 * @returns
 */
export function reject(obj?: Object) {
  return request({
    url: '/pm/rdReply/reject',
    method: 'POST',
    data: obj,
  });
}

/**
 * 撤回
 * @param obj
 * @returns
 */
export function abandon(obj?: any) {
  return request({
    url: `/pm/rdReply/abandon?comment=${obj.comment}`,
    method: 'POST',
    data: obj,
  });
}

/**
 * 打开
 * @param obj
 * @param id
 * @returns
 */
export function open(id?: string) {
  return request({
    url: '/pm/rdReply/open/' + id,
    method: 'POST',
  });
}

/**
 * 关闭
 * @param obj
 * @param id
 * @returns
 */
export function close(obj?: Object) {
  return request({
    url: '/pm/rdReply/close',
    method: 'POST',
    data: obj,
  });
}
